<?php
/**
 * @filename TurkeyAdapter.php
 * @author LD King
 * @encoding UTF-8
 * @date 2008-9-5 | 下午07:54:51
 * @package Example
 * @subpackage 
 * @usage 需要把火鸡装成鸭子，所以有了这个适配器
 * @note 
 * @copyright Copyright (c) 2007 - 2008 LD (http://mifunny.info)
 * @version $Id: $
 */
include_once 'Turkey.php';
include_once '../01-duck.php';

/**
 * 把鸡大扮成鸦
 *
 */
class TurkeyAdapter extends Duck {
	 
	/**
	 * 鸡对象
	 *
	 * @var TurKey
	 */
	private $turkey;
	
	/**
	 * 传入鸡对象
	 *
	 * @param TurKey $turkey
	 */
	public function __construct($turkey) {
		$this->turkey = $turkey;
	}

	/**
	 * @see Duck::display()
	 *
	 */
	public function display() {
		echo "OK， I'm just a turkey.";
	}
	
	/**
	 * @see Duck::perfromFly()
	 *
	 */
	public function perfromFly() {
		echo "Flying with TurKeyAdapter.<br />";
		$this->turkey->fly();
	}
	
	/**
	 * @see Duck::perfromQuack()
	 *
	 */
	public function perfromQuack() {
		echo 'Quacking with TurKeyAdapter.<br />';
		$this->turkey->gobble();
		
	}
}
?>